import { sendRequest } from '@/http';

const baseUrl = '/admin/platform';

const TypeCode = ['nation'] as const;
type TypeCode = (typeof TypeCode)[number];

/**
 * 查询字典
 * @param
 * @returns
 */
export const queryDictionary = (code: string) => {
  return sendRequest({
    url: `${baseUrl}/queryDictionary`,
    method: 'get',
    params: {
      typeCode: code,
    },
  });
};

/**
 * 民族下拉选项
 * @param
 * @returns
 */
export const queryEthnicityOptions = () => {
  return queryDictionary('nation');
};

/**
 * 查询基础地区信息
 * @param params
 * @returns
 */
export const queryBaseAreaInfo = () => {
  return sendRequest({
    url: `${baseUrl}/queryBaseAreaInfo`,
    method: 'get',
  });
};
